/*
 * Buffer.h
 *
 *  Created on: 12.10.2011
 *      Author: artur
 */

#ifndef BUFFER_H_
#define BUFFER_H_

#include "IBuffer.h"

class Buffer: public IBuffer {

	int pagesize;
	int count;
	int readCode;
	int openCode;
	int openCode1;
	char *buffer2;
	char *buffer1;
	char *outputBuffer;
	char *next;
	char *InputNext;
	char *base;
	char output;
	void loadPuffer1();
	void loadPuffer2();
	void writeFile();
public:
	Buffer(const char * const filename, const char * const output);
	virtual ~Buffer();
	void alloc();
	virtual void ungetchar(size_t times);
	virtual int getchar();
	virtual void putchar(char value);
	//void lexemAcceped();
	void close();
};

#endif /* BUFFER_H_ */
